/* A structure representing one object on the screen */

#ifndef MC_CHART_BOX_HPP
#define MC_CHART_BOX_HPP

#include <map>

#include <gtkmm/label.h>
#include <gtkmm/widget.h>

#include <memchart/types.hpp>

#include "vector2.hpp"

namespace memchart
{
	struct chart_box
	{
		/* The box itself */
		shared_ptr<Gtk::Widget>  widget;

		/* Pointers to labels corresponding to class member values */
		vector<Gtk::Label *>     members;

		/* List of other boxes this box is connected to */
		vector<uintptr_t>        edges;

		string                   type_name;

		/* Used for graph traversal */
		bool                     seen;
		size_t                   parent_count;

		/* Used for DAG layout */
		size_t                   level;
		size_t                   lparent_count, rparent_count, child_count;

		/* Used for generic layout */
		vector2                  velocity, position, force;
	};

	/* Box map */
	typedef std::map<uintptr_t, chart_box> box_map;

	typedef box_map::iterator box_iter;
	typedef vector<uintptr_t>::iterator edge_iter;
}

#endif /* MC_CHART_BOX_HPP */
